// /////////////////////////////////////////////////////////////////////////////
//
// Name:            AIScript.h
// Author:          Michael Bartsch
//
// Desc:            This file contains the Glue functions that enable the
//                  interaction between CAICore and Lua.
//
// License:         Copyright (C) 2008-2009 Michael Bartsch
//
//                  This program is free software: you can redistribute it
//                  and/or modify it under the terms of the GNU General Public
//                  License as published by the Free Software Foundation,
//                  either version 3 of the License, or (at your option) any
//                  later version.
//
//                  This program is distributed in the hope that it will be
//                  useful, but WITHOUT ANY WARRANTY; without even the implied
//                  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
//                  PURPOSE. See the GNU General Public License for more
//                  details.
//
//                  You should have received a copy of the GNU General Public
//                  License along with this program. If not, see
//                  <http://www.gnu.org/licenses/>.
//
// /////////////////////////////////////////////////////////////////////////////

#if !defined(__AISCRIPT_H_INCLUDED__)
#define __AISCRIPT_H_INCLUDED__

// Include required header file(s).
#include "../AICore.h"
#include "./ScriptManager.h"


// Main function:
//! Register all function in this file into the Lua Scripting Language.
//!
//! The functions can be accessed through AICore:<function> (notice
//! the colon!) or ai<function>.
extern void registerAI(lua_State *L);

// Glue functions:
//! Glue function for CAICore::update.
extern int lua_ai_update(lua_State *L);

//! Glue function for CAICore::calculatePath.
extern int lua_ai_calculatePath(lua_State *L);
//! Glue function for CAICore::checkEnvironment.
extern int lua_ai_checkEnvironment(lua_State *L);

//! Glue function for CAICore::getStartX.
extern int lua_ai_getStartX(lua_State *L);
//! Glue function for CAICore::getStartY.
extern int lua_ai_getStartY(lua_State *L);
//! Glue function for CAICore::getTargetX.
extern int lua_ai_getTargetX(lua_State *L);
//! Glue function for CAICore::getTargetY.
extern int lua_ai_getTargetY(lua_State *L);
//! Glue function for CAICore::getNextX.
extern int lua_ai_getNextX(lua_State *L);
//! Glue function for CAICore::getNextY.
extern int lua_ai_getNextY(lua_State *L);

//! Glue function for CAICore::getRotation.
extern int lua_ai_getRotation(lua_State *L);

//! Glue function for CAICore::getIsTarget
extern int lua_ai_getIsTarget(lua_State *L);

//! Glue function for CAICore::getAgentState.
extern int lua_ai_getAgentState(lua_State *L);

//! Glue function for CAICore::getIsWaiting
extern int lua_ai_getIsWaiting(lua_State *L);

//! Glue function for CAICore::setStartLocation.
extern int lua_ai_setStartLocation(lua_State *L);
//! Glue function for CAICore::setStartX.
extern int lua_ai_setStartX(lua_State *L);
//! Glue function for CAICore::setStartY.
extern int lua_ai_setStartY(lua_State *L);

//! Glue function for CAICore::setTargetLocation.
extern int lua_ai_setTargetLocation(lua_State *L);
//! Glue function for CAICore::setTargetX
extern int lua_ai_setTargetX(lua_State *L);
//! Glue function for CAICore::setTargetY.
extern int lua_ai_setTargetY(lua_State *L);

//! Glue function for CAICore::setRotation
extern int lua_ai_setRotation(lua_State *L);

//! Glue function for CAICore::setNodeState
extern int lua_ai_setNodeState(lua_State *L);

//! Glue function for CAICore::setIsTarget
extern int lua_ai_setIsTarget(lua_State *L);

//! Glue function for CAICore::setAgentState
extern int lua_ai_setAgentState(lua_State *L);

//! Glue function for CAICore::setIsWaiting
extern int lua_ai_setIsWaiting(lua_State *L);

//! Glue function for CAICore::resetMap
extern int lua_ai_resetMap(lua_State *L);

#endif

